﻿@model IEnumerable<string>

<h1>
@ViewBag.IntRef
</h1>

<div id="accordion">
@{
	int iCounter = 1; 
	foreach (var item in Model)
	{
    <h3>@item</h3>
    <div id="showleads@(iCounter.ToString())"></div>
		iCounter++;
	}
}
</div>
	
<script type="text/javascript">
    $(document).ready(function () {

    $('#leadslist').hide();
    $('#orderslist').hide();
    $('#diarylist').hide();

    $(function() {
        $( "#accordion" ).accordion({
          heightStyle: "content"
        });
    });


    @{
        iCounter=1;
        foreach(var item in Model)
        {
            <text>
                $("#showleads@(iCounter.ToString())").html('<div style="text-align: center;"><div><img src="@Url.Content("~/Images/ajaxspinner_large.gif")" alt="Loading..." style="margin: 20px;" /></div><div>Loading...</div></div>');
                $('#showleads@(iCounter.ToString())').load('@(Url.Action("ShowLeadsByDate", "Outsourcer"))?leadDate="@(item)"&id=@(ViewBag.LeadID)&indexer=@(iCounter.ToString())&callCentreID=@(ViewBag.CallCentreID)&returnsOnly=@(ViewBag.ReturnsOnly)');
            </text>
            iCounter++;
        }
    }

    });
</script>